<template>
    <div >
        <el-breadcrumb separator="/" style="float: left;">
    <el-breadcrumb-item  v-for="(item,index) in routes" :key="index" :to="{ path: item.path }">{{item.title}} <span @click.stop="xx(item)">X</span></el-breadcrumb-item>
        
        </el-breadcrumb>
<!-- 下拉菜单 -->
    <el-select v-model="form.region" placeholder="标签选项" style="float: right; width: 120px;" @change="sd">
      <el-option label="删除所有" value='1'></el-option>
      <el-option label="删除当前" value="2"></el-option>
    </el-select>

<br>
<br>
    </div>
</template>
<script>
export default {
    data() {
        return {
            form:{
                region:''
            }
        }
    },
    mounted() {
        // console.log(this.weidu);
    },
    methods: {
        sd(){
           if(this.form.region==1){
                this.$store.commit('tabLists/sd')
        }else{
            this.$store.commit('tabLists/scdq')
            // this.routes.splice(0,1)             
        }
        },
        xx(item){
            for (let i = 0; i < this.routes.length; i++) {
                if(this.routes[i].id==item.id){
                    // this.routes.splice(i,1)
                    this.$store.commit('tabLists/xx',i)
                }                
            }
        }
    },
    computed:{
        routes:{
            get:function(){
                return this.$store.state.tabLists.bread
            }
        }
    }
}
</script>